from qiyeweixin.page_objects.page_base import PageBase
from selenium.webdriver.common.by import By
from qiyeweixin.utils_tool.logging_info import logger

'''首页'''
class PageHome(PageBase):

    __BTN_ADD_MEMBER = (By.XPATH, "//*[text()='添加成员']")
    __BTN_ADDRESS_BOOK_MENU = (By.XPATH, "//*[text()='通讯录']")

    #首页：点击【添加成员】按钮
    def click_add_member(self):

        logger.info("1、首页：点击【添加成员】按钮")
        self.do_click(self.__BTN_ADD_MEMBER)

        from qiyeweixin.page_objects.page_create_member import PageCreateMember
        return PageCreateMember(self.driver)

    #首页：点击【通讯录】菜单
    def click_address_book_menu(self):
        logger.info("1、首页：点击【通讯录】菜单")
        self.do_click(self.__BTN_ADDRESS_BOOK_MENU)

        from qiyeweixin.page_objects.page_address_book import PageAddressBook
        return PageAddressBook(self.driver)

